
Option Strict On : Option Explicit On : Option Compare Binary : Option Infer On

Imports System
Imports System.Collections.ObjectModel
Imports System.Text.RegularExpressions


Namespace Code.Coloriser

    ''' <summary>
    ''' Default code coloriser for CSharp
    ''' </summary>
    ''' <remarks></remarks>
    Friend Class CSharpCodeColoriser
        Inherits CCodeColoriser

        'Sub New()
        '    'Me.keywords = New String() {"(?:\u0023)region", "(?:\u0023)endregion", _
        '    '                            "(?:\u0023)if", "(?:\u0023)else", _
        '    '                            "(?:\u0023)elif", "(?:\u0023)endif", _
        '    '                            "abstract", "as", "base", "bool", _
        '    '                            "break", "by", "byte", "case", _
        '    '                            "catch", "char", "checked", "class", _
        '    '                            "const", "continue", "decimal", "default", _
        '    '                            "delegate", "do", "double", "descending", _
        '    '                            "explicit", "event", "extern", "else", _
        '    '                            "enum", "false", "finally", "fixed", _
        '    '                            "float", "for", "foreach", "from", _
        '    '                            "goto", "group", "if", "implicit", _
        '    '                            "in", "int", "interface", "internal", _
        '    '                            "into", "is", "lock", "long", _
        '    '                            "new", "null", "namespace", "object", _
        '    '                            "operator", "out", "override", "orderby", _
        '    '                            "params", "private", "protected", "public", _
        '    '                            "readonly", "ref", "return", "switch", _
        '    '                            "struct", "sbyte", "sealed", "short", _
        '    '                            "sizeof", "stackalloc", "static", "string", _
        '    '                            "select", "this", "throw", "true", _
        '    '                            "try", "typeof", "uint", "ulong", _
        '    '                            "unchecked", "unsafe", "ushort", "using", _
        '    '                            "var", "virtual", "volatile", "void", _
        '    '                            "while", "where", "yield"}

        '    'Me.m_nonKeywordRegexStr = "@\w+"
        '    'Me.m_stringOrCharRegexStr = "(@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).')" '"("".*?"")|('.*?')"
        '    'Me.m_commentRegexStr = "//.*|/\*.*?\*/"
        'End Sub

        Protected Overrides ReadOnly Property StringOrCharRegexStr() As String
            Get
                Return "@?""""|@?""[^\r\n]*?(?!\\).""|''|'[^\r\n]*?(?!\\).'"
            End Get
        End Property

        Protected Overrides ReadOnly Property Keywords() As String
            Get
                Return "abstract as base bool break byte case catch char " _
                & "checked class const continue decimal default delegate do double else " _
                & "enum event explicit extern false finally fixed float for foreach goto " _
                & "if implicit in int interface internal is lock long namespace new null " _
                & "object operator out override partial params private protected public readonly " _
                & "ref return sbyte sealed short sizeof stackalloc static string struct " _
                & "switch this throw true try typeof uint ulong unchecked unsafe ushort " _
                & "using value virtual void volatile where while yield"
            End Get
        End Property


        Protected Overrides ReadOnly Property Preprocessors() As String
            Get
                Return "#if #else #elif #endif #define #undef #warning " _
                & "#error #line #region #endregion #pragma"
            End Get
        End Property

    End Class

End Namespace

